-- GENERATED SPELL FOR [Marshfang Slicer] --


function spell0_18131(pUnit, Event) --@Drain Mana,Drain--
pUnit:FullCastSpellOnTarget(17008,pUnit:GetRandomPlayer(4))
pUnit:RegisterEvent('Sorts_18131', 5000, 1)
end

function spell1_18131(pUnit, Event) --@Nether Shock,n/a--
pUnit:FullCastSpellOnTarget(35334,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18131', 3306, 1)
end

function spell2_18131(pUnit, Event) --@Tail Swipe,n/a--
pUnit:FullCastSpellOnTarget(35333,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18131', 538, 1)
end

function Sorts_18131(pUnit, Event)
local choix_sorts_18131 = math.random(0, 2)
if choix_sorts_18131 == 0 then
pUnit:RegisterEvent('spell0_18131', 1, 1)
end
if choix_sorts_18131 == 1 then
pUnit:RegisterEvent('spell1_18131', 1, 1)
end
if choix_sorts_18131 == 2 then
pUnit:RegisterEvent('spell2_18131', 1, 1)
end
end

function mob18131_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18131', math.random(1500, 3000), 1)
end

function mob18131_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18131_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18131_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18131, 1, 'mob18131_Action')
RegisterUnitEvent(18131, 2, 'mob18131_Leave')
RegisterUnitEvent(18131, 3, 'mob18131_Kill')
RegisterUnitEvent(18131, 4, 'mob18131_Die')
